export async function queryLawRegulations(type, title, module, kind) {
  try {
    const response = await fetch(`/api/queryLaw?type=${type}&title=${title}&module=${module}&kind=${kind}`)
    const data = await response.json()
    return data
  } catch (error) {
    console.error(error)
    throw error
  }
}

export async function queryCases(title, module, court, case_number) {
  try {
    const response = await fetch(
      `/api/queryCase?title=${title}&module=${module}&court=${court}&case_number=${case_number}`
    )
    const data = await response.json()
    return data
  } catch (error) {
    console.error(error)
    throw error
  }
}
